package com.atguigu.lease.common.exception;

import com.atguigu.lease.common.result.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author Tsuchi
 * @description TODO
 * @date 2024/12/22 17:21
 */
@RestControllerAdvice
public class MyExceptionHandler {
	@ExceptionHandler(LeaseException.class)
	public Result leaseException(LeaseException e){
		e.printStackTrace();
		return Result.fail(e.getCode(),e.getMessage());
	}
}
